#include <cstdio>

typedef unsigned long long int uint;


template <typename N>
inline void set_min (N &a, const N &b)
{
	if (a > b)
		a = b;
}


inline uint binom (uint n, uint k)
{
	uint r, ni, ki;

	set_min (k, n - k);
	r = 1;
	for (ni = n, ki = 1; ki <= k; --ni, ++ki)
	{
		r *= ni;
		r /= ki;
	}

	return r;
}


int main ()
{
	uint n, k;

	while (scanf ("%llu %llu", &n, &k), n != 0)
		printf("%llu\n", binom (n, k));

	return 0;
}